UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ypLLWaPC1kbFZTNuTrvpiN7E/Ue8TkP9VC5ETp2nmdI='
WHERE
key_id = '696ce5241c36332ab7a64adfddad33570486d88ebd1b325ebacc8e1c17cef2a0'
AND (
token = 'ypLLWaPC1kbFZTNuTrvpiN7E/Ue8TkP9VC5ETp2nmdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)