All modern BMW vehicles use an electrical locking system. Most commonly, a blown fuse is the culprit with problematic locks. Generally the fuse box is located underneath the left speaker on the driver's side, but some models are different. Consult your manual to pin point which fuse connects to which locks. For example, if your having problems with the front door locks, the manual will tell you which fuse connects to the front door locks and that will be the fuse you want to replace. Since new fuses only cost around £2 a piece, so this should always be the first place to look.
Central Lock Module
Being a luxury car almost everything on the BMW is computerised. If you have moved past the fuse box and you still have problems it's time to again pull out your manual and find the central lock module. The central lock module is a small computer that communicates with the gas door locks, boot locks and as well as the doors. If you are experiencing problems with the boot and gas tank, the central lock module may be the problem. Look for loose, exposed, or tangled wires around this computer.
If you are experiencing problems with only one door lock and the others work fine, the lock motor is most likely broken. It's important to fix the broken lock motor right away because it can cause shorts in the fuse box. A short fuse could then cause other malfunctions.