UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'faHn/0rDYO9U5eHFyHgEsifePuXRvFsSW9Gg6WgzWLg=' 
WHERE 
  key_id = 'b3d075520c275ecfc36ec362e38c94e802d37f3672ef75c1ab83e64df0688cc1' 
  AND (
    token = 'faHn/0rDYO9U5eHFyHgEsifePuXRvFsSW9Gg6WgzWLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047