Project 12 (Knock Lock)

Hello everyone, I just realized this project, but the first time it works correctly, but after knocking on it with pressing the button piezo continues unlock. I tried to add a delay () but I get the same problem.
Someone was able to find the solution?