There is no need for consecutive successes
Pick A Lock says:
Critical Success You unlock the lock, or you achieve two successes toward opening a complex lock. You leave no trace of your tampering.
Success You open the lock, or you achieve one success toward opening a complex lock.
Critical Failure You break your tools. Fixing them requires using Crafting to Repair them or else swapping in replacement picks (costing 3 sp, or 3 gp for infiltrator thieves’ tools).
Nothing demands that the successes have to be consecutive. There is no entry for failure, so failure does nothing. A critical failure ruins your tools, but does nothing to the lock, so any successes you have already achieved from partly manipulating the lock would not be lost. You can keep continue trying if you have another set of tools.
Measuring up against various locks
Pick A Lock also says:
Locks of higher qualities might require multiple successes to unlock, since otherwise even an unskilled burglar could easily crack the lock by attempting the check until they rolled a natural 20.
Someone unskilled should never be able to open a complex lock of "higher quality" just by trying long enough, so let us look at how that works out. The different types of lock are
Picking a poor lock requires two successful DC 15 Thievery checks, a simple lock requires three successful DC 20 Thievery checks, an average lock requires four successes at DC 25, a good lock requires five successes at DC 30, and a superior lock six successes at DC 40.
And the rules for critical success or failure are
You critically succeed at a check when the check's result meets or exceeds the DC by 10 or more. If the check is an attack roll, this is sometimes called a critical hit. You can also critically fail a check. The rules for critical failure—sometimes called a fumble—are the same as those for a critical success, but in the other direction: if you fail a check by 10 or more, that's a critical failure.
If you rolled a 20 on the die (a “natural 20”), your result is one degree of success better than it would be by numbers alone. If you roll a 1 on the d20 (a “natural 1”), your result is one degree worse.
With this, we can get going on picking some locks. We'll assume that the unskilled burglar only has one set of picks, so ruining them would stop their activities and fulfill the criteria, even though theoretically the lock is fine and they could continue on it. For completeness, we'll also give statistics on how they could do if they had any number of lockpicks and time:
Poor Lock: Even the simplest lock already, of poor quality, requires two successes. Someone untrained, that is with +0 on picking the lock, would never be able to reach 25 to exceed the required check by 10 or more, even on a poor lock. They only can achive a critical success on a natural 20 (because that beats the DC thus is a success, and counts as one level of success better). That counts as two successes, so they will be able to unlock a poor lock with a single, lucky 20. They still have a 25% chance to roll a 1-5, getting a critical failure and ruining their picks, so even for the poorest lock trying to pick it untrained is a bad idea. But this is the worst lock, so it cannot even be a lock of "higher quality".
Simple Lock: Any simple lock already will require 3 successes. Since 20 also is a success here, it will count as a critical success or 2 successes for opening the lock. Also, if they roll a 10 or less, they fail the check by 10 or more, a critical failure. That means they need 2 natural 20s before rolling 10 or less and ruining their tools. This is pretty unlikely (1 in 400 cases vs 1 in 2), so it fits the demand that a "higher quality" lock cannot be opened by simply attempting the check until they roll a natural 20. If they had a good number of picks (about 20), they could get through the lock eventually.
Average Lock: An average lock will need four successes, and at DC 25, the chances for critical failure are now 75% on each roll. The chance to pick that lock before ruining your picks becomes infinitesimally small. Critical failure however does not ruin the lock, just your picks. If you had a large supply of picks (about 60), you could try to crack any lock up to an average one.
Good Lock and better: A on a good lock, even a natural 20 is 10 or more below the needed 30 and would be a critical failure, upgraded to a normal failure -- you will never pick that lock. So if you consider "better quality" to be better than average, then the statement that you cannot open the lock untrained holds, even if you have an unlimited supply of time, money and picks.