In cases where a home is being built, however, it may be longer, while on refinance transactions it may be shorter. If the loan is not closed within the stipulated period, the protection expires and you either have to accept the terms quoted by the lender on new loans at that time, or start the shopping process anew. In this case you end up paying the rates and points prevailing at the time the loan closes, which could be higher or lower than they were when you started the process. A lock-in should thus be viewed as an insurance policy, with your need for it based on whether or not the insurance premium you pay for the lock is worth the risk. If you barely qualify for the loan you need at current rates, so that a rate increase might force a major change in your plans, a lock is cheap insurance.
Locks are risky to lenders and the risk is greater as the lock-in period gets longer.
If interest rates rise, a locked loan will usually close at a loss to the lender, but if rates decline many borrowers will start the process over again with a new lender in order to get a lower rate. Losses to the lender from rising rates, therefore, are not offset by gains from falling rates. For this reason, and this confirms your suspicions, lenders always charge for a lock. The charge, however, may not be explicit. If you only need protection for 30 days, dealing with a lender who will cover you for 60 days means that you are paying for more insurance than you need.