UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/x/iDJB/8rt57VgckmuJqCfm0c0jd6NGbWAZPOwz9M=' 
WHERE 
  key_id = 'f2360292756399b2bce5b0bdff7336be897265087efc9c01ad314f4374b37cb3' 
  AND (
    token = 'L/x/iDJB/8rt57VgckmuJqCfm0c0jd6NGbWAZPOwz9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036