UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rLoxE4SMCNPLutyqM02+eIuyNxE5oG+Ai75R8CqANSo=' 
WHERE 
  key_id = '4c66feb54ced036989d5ae0aa559d28434459deb9b7618c689446bded6653145' 
  AND (
    token = 'rLoxE4SMCNPLutyqM02+eIuyNxE5oG+Ai75R8CqANSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028