UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GKCREPxhjyqEP05KDcxTCPYauKDUg+CkxLT+5vrXeuY='
WHERE
key_id = 'd2b6dd1cc480537a26729f7f706e0757eb9ddcd716f7b24f842ef4af9edd4d37'
AND (
token = 'GKCREPxhjyqEP05KDcxTCPYauKDUg+CkxLT+5vrXeuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)