Stymied in search for an electronic lock
A quick and dirty solution is a small motor with a shaped stick that locks into a slot. If you want it to be more robust, you can just use the motor to stick the bar into the slot, without relying on its robustness.



Another idea is a coil, but it's easily opened by a magnet.

IMPORTANT: Remember that with an electric lock, you are subject to the reliability and battery/supply to the circuit. In case something fails, make sure you have an alternative (not that good for a lock).