Hello. One way to help see if it might be a key issue would be to use the other key/remote when the locks are not locking/unlocking and see if that has any effect on the doors. The reason why you can't open the doors when this happens is that the door locks are in double lock. Also try to use the key in the door lock manually to see if the doors lock/unlock. This should also send a lock/unlock symbol to the general module. Usually the fault is in the door lock actuators but to have all three go at the same time, while possible, is unusual. The problem could be in the key/remote, in the vehicle where it receives the signals from the remote, in the door lock actuators, or the body module that relieves the unlock signal. If that is the case your local dealer will have to use their diagnosis equipment to check for signals to and from the vehicle locking system.
I hope this was helpful.
-Roger
Bmw Master Technician
BMW Mechanic
Level 1 BMW Master Certification, 9 Years Dealer experience, Team Leader, Shop Foreman