UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TKyqTq7DjC2CMeXlbBUzmTC0u87ZqBUBnAG4ugJvvLc='
WHERE
key_id = '96b142d3c0769fbf0464a9104eb109634bdfa0923a714b2ef61910ba0c360cd5'
AND (
token = 'TKyqTq7DjC2CMeXlbBUzmTC0u87ZqBUBnAG4ugJvvLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)