UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VC1T8UGadayzIq8G8rV1oAoA2G+p9qGw2iLq7aI2Jos=' 
WHERE 
  key_id = '80654e04c4bd37dc246130f52647dd7da8ef63c82e088ef1f5156ac797657396' 
  AND (
    token = 'VC1T8UGadayzIq8G8rV1oAoA2G+p9qGw2iLq7aI2Jos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043