UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmZs2bc27pwJ+Gcj1M3Urr/RlrYzxjEcBY0eBMRsr8w='
WHERE
key_id = 'cf2cdba8475a3e5efdc8640c4b6d59457e4a1b5fa8435c52a99c865d278407de'
AND (
token = 'JmZs2bc27pwJ+Gcj1M3Urr/RlrYzxjEcBY0eBMRsr8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)