UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fhb7V3dVN9uxTtIQ1BRjW0hWewT/LerRW8Sv5MSFwJk='
WHERE
key_id = '245159b03318fe9571c521d7b5db0d1e8f728e717b82484b25ef4f36847b99f6'
AND (
token = 'Fhb7V3dVN9uxTtIQ1BRjW0hWewT/LerRW8Sv5MSFwJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)