UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qi5noLaC4CTBO/eYW/ef7AGNWeI8J0N/9a0x9DsXG8s='
WHERE
key_id = '246adf439a4eb8a3b9c2ec83a932594ea85b3e374f4241da45b92897d6bc4c73'
AND (
token = 'Qi5noLaC4CTBO/eYW/ef7AGNWeI8J0N/9a0x9DsXG8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)