It's likely the door lock actuator, had the same issue in my first e39.

this is a fairly decent DIY