A 'key' by your definition ...
Now you’re just being silly! ;^)
” Keys are used to open and lock things.”
No. Keys are used to unlock and lock things.
Openers are used to open things.