A rate "lock" or "commitment" is a lender's promise to freeze a specific interest rate and a particular number of points for you for a certain period of time while your application is processed. This means your interest rate won't grow while you are going through the application process.
Although there are various lengths of rate lock periods (from 15 to 60 days), the longer spans are typically more expensive. A lender may agree to freeze an interest rate and points for a longer span of time, say 60 days, but in exchange, the rate (and sometimes points) will be more than that of a rate lock of fewer days.
In addition to choosing a shorter lock period, there are more ways you can attain the best rate. A bigger down payment will give you a better interest rate, since you'll be starting out with a good deal of equity. You can pay points to reduce your interest rate for the life of the loan, meaning you pay more initially. One strategy that is a good option for some is to pay points to bring the rate down over the term of the loan. You'll pay more initially, but you'll come out ahead, especially if you keep the loan for the full term.