This electronic key may be used to drive a door lock or a security alarm.  If all keys are pressed in the right sequence, the output of the gate number 5  (IC2, pin3) turns on and through a transistor activates the unlock relay.

As you can see in the logic diagram, the gate number 5 gets high if the 5th key is pressed and the gate number 4 is on (due to the AND gate number 9);  the previous stages work in the same way.

Each of the gates  number 10, 11, 12, 13 turns on if a key (from 2 to 5)  is pressed and the previous stage (gates from 1 to 4) is off, in other words when you press a wrong button; if that happens a reset signal will lead the circuit to the start condition.

To full understand how this electronic key works you may visit this simulation board.