UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'crQKlC2W1ImkficPE8fEOSq7tF61YErCpIAOh53V3qs='
WHERE
key_id = '818ac22d65305d406c92a347a181107305b80903ef4b04a9010d95d9ef2e307a'
AND (
token = 'crQKlC2W1ImkficPE8fEOSq7tF61YErCpIAOh53V3qs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)