UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'msr26qPmJ0vcCMEghRMjm4tPT1FkVgFb424GCwoJWsk='
WHERE
key_id = '95bffce6f9427975e902dcdc7a9a3e960b901c7288be745ba6ba8d904fbc3a10'
AND (
token = 'msr26qPmJ0vcCMEghRMjm4tPT1FkVgFb424GCwoJWsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)