UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dL+sMIWwzynnwWExOy0u4UDjsTRPFR2fY9RlqSmQFmc='
WHERE
key_id = '9d6e102ea6623338d193b6ff1a5783114a865a06ce418af3ced058c4a09f5bd2'
AND (
token = 'dL+sMIWwzynnwWExOy0u4UDjsTRPFR2fY9RlqSmQFmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)