It's not as simple as that and I found I needed the knack of doing it.
You will notice that the cap turns and turns and turns when it is locked.
Hold it still and insert the key then turn the key anti-clockwise a quarter turn. It goes slightly more than a quarter turn, but turn it until it stops. The cap is then unlocked.
With the key remaining in this position, turn the cap a quarter turn anti-clockwise to release it and pull it out. There's a handy hook on the fuel cap access door to hang it on.
To replace the cap, insert it into the hole and engage the lugs. DO NOT turn the key yet!!
Turn the cap clockwise until is clicks. If you continue to turn it, it will continue to click. Hold it still, and turn the key clockwise a quarter turn and then pull it out. Make sure that the cap will turn and turn and turn to make sure it's locked.
What I have found, is that the mechanism can be stiff and difficult. I cured it by getting oil into the key hole and working the lock quite a bit to free it up. No doubt I'll have to do this again sometime.
Cheers,
Mick.