The murderer was the first one / among the first ones who found the dead body in the supposedly locked room, which was actually open all the time. The killer had the key with himself/herself, and pretended that he/she is unlocking the already unlocked door, and then when everyone was busy being shocked by the dead body/bodies, the murderer put the key back to it's original place without anyone else noticing.