If the keypad is used to enter the flight deck, the door WILL OPEN after a predetermined time 5-30sec UNLESS someone physically LOCKS the door from INSIDE the cabin.
If the F/O was simply incapacitated, then this tragedy would in all probability not have happened.