UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xr6z/eYZ1PTqGuclqvjqStTYiPsY3bXJylGJbwsimFM='
WHERE
key_id = '5cfa4eba553804ea4eb795e96d55698652a079d6470b78413db7d849863dc78e'
AND (
token = 'xr6z/eYZ1PTqGuclqvjqStTYiPsY3bXJylGJbwsimFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)