UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ka8LSnXVorovQiyMPs8xVk3KylJ7C4mYTb0JDkevezY=' 
WHERE 
  key_id = '1132ed9d1fb0bf6a487626c3071b1a26fdb8b0fa72cf42f3954163d941d3964c' 
  AND (
    token = 'Ka8LSnXVorovQiyMPs8xVk3KylJ7C4mYTb0JDkevezY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016