UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'slBIkNEqz7gwfSFFu/IdMxDjvrwsGkYcUw6sQwH4EBU='
WHERE
key_id = 'e1683f15c6e4dc32fccee8aa1c0f6e9b01306672b1c9ae3fed1a152a7b619c5c'
AND (
token = 'slBIkNEqz7gwfSFFu/IdMxDjvrwsGkYcUw6sQwH4EBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)