UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '380uNiel2NlQwSG6YUbUrtA2x22DcQmuOL7U8hEv/c4='
WHERE
key_id = 'c3e2e9696ccdb9876b1b60cc6cfdcb7fd0c289636d7b61ae50abd84ea016df4a'
AND (
token = '380uNiel2NlQwSG6YUbUrtA2x22DcQmuOL7U8hEv/c4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)