UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dQF2eifIVctjvVv30Zecoqi7Y2dYYliSpT4x2jJg5og='
WHERE
key_id = '4cc4024c7062cf439faadbb1bb60b4dd382234dc0465a6f4ce7f3a1e6ad33958'
AND (
token = 'dQF2eifIVctjvVv30Zecoqi7Y2dYYliSpT4x2jJg5og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)