Lock in as many of the costs you can, the rate as well as points. That could be weeks away and rates could change unfavorably in the current market. Shop around for both the terms of the lock contract and its cost. Others might charge the fee at settlement. The fee might be a flat fee, a percentage of the mortgage amount, a fraction of a percentage point or a higher interest rate.
Some lenders offer the service at no cost.
How much you pay will vary among lenders depending upon the length of the lock-in period, the options you choose, and whether to mortgage rate is fixed or adjustable and if it's a purchase or a refinance. The lock-in period should be long enough to allow for settlement, contingencies imposed by the lender or purchase contract and other factors that could delay the process. Most range from 15 to 60 days. Anything longer could be cost prohibitive. Consider all factors that could delay your settlement, including the time it will take you to provide requested materials about your financial condition, unanticipated construction delays on a new house and the like.