How to turn the handle when the door is closed

The variable “Locked” is needed for the key. And when I try to turn the handle through the “Timeline” the door starts to twitch. Need to handle rotated provided that the door is closed (not the key)