why isn't it an electronic lock that prevents operation of the machine if it's not locked?
Why not make it simpler and make it a magnetic lock that simply locks the door by being pulled towards the machine? (With a mechanical override so you can get in if you really want to and have the key.)