Why are you using INPUT to switch off the lock? Not OUTPUT, LOW? That would at least make sure the port is actually pulled low.
Writing HIGH or LOW to a port that's set to INPUT has no effect whatsoever. It's an input, it's almost as if it's completely disconnected, having little to no effect on what it's connected to.
To be able to toggle a port HIGH or LOW it's got to be an OUTPUT. Just never set it to INPUT when you want to use it as an OUTPUT, which is what you are doing.
Surprised on-one picked up on that yet. It's just odd. That 1M resistor also doesn't sound necessary, and with such a large resistance probably gets in the way of things working well.
I second the other posters about circuit diagrams. Learn how they work, how to read them and how to write them. Without it you have little chance to ever get correct wiring the moment your circuit becomes more complex than a switch, and even in that case it often proves helpful, especially if after a year you look at your project again wondering "how the heck is that wired??".