UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U8BWYFXnwVcqdvwxYNmfZNQCUFYsbFETD093TeowUKI=' 
WHERE 
  key_id = '93f1e6793d736de288d74c751534b6fab783776f1629102d42f67d2f9071bc4a' 
  AND (
    token = 'U8BWYFXnwVcqdvwxYNmfZNQCUFYsbFETD093TeowUKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032