Looking for a "mini-locker" (secret box)

Magnets aren't locks. You can choose a strong magnet that will make it close enough to impossible to open but then you'll need a strong electromagnet to cancel the field of the permanent magnet. Packing a 20A power supply into a box just a few cm wide will be difficult.

You can get "switchable" permanent magnets. Basically one magnet that can rotate inside another. When they are lined up, the field is strong and when they are 90 degrees, the field is weak. Look at how magnetic-base dial gauges work. But the force required to turn the control magnet is still high - easy to do by hand but hard to do with a small actuator that fits in a box.

I bought some really tiny linear actuators off eBay a few years ago. I can't find a picture but the whole thing fit on my thumbnail. A little tiny stepper motor drove a shaft with a spiral groove. I think it was 6 for $1 or something like that. I think you should find something like that and connect it to a latch. It would only use a tiny amount of power to lock or unlock and no power when not moving. They are so small, I would consider using only 2 coin cell batteries to power them.

Another source of small linear actuators is the mechanism inside a CD or DVD drive which moves the lens assembly. They are steppers so they will need 4 control wires but it should not cost you anything to pull apart a broken device and use the motor.