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