UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Q6xnED7N/RZ+gFwTBcsf9beWpk7c2Ym90OF+Z1WITA='
WHERE
key_id = '563f51220b1f377c9015e92854368bf34366ac7a7780bbdf2aa47b23280f2a64'
AND (
token = '3Q6xnED7N/RZ+gFwTBcsf9beWpk7c2Ym90OF+Z1WITA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)