When you are offered a "rate lock" from the lender, it means that you are guaranteed to get a particular interest rate for a determined period while you work on your application process. This protects you from going through your entire application process and learning at the end that your interest rate has risen higher.
Although there are various lengths of rate lock periods (from 15 to 60 days), the longer spans are usually more expensive. You can get a longer period for your lock, but in doing so, will likely have a higher interest rate than you would have with a shorter rate lock period
There are other ways to get a lower rate, in addition to going with a shorter rate lock period. A bigger down payment will result in a better interest rate, since you'll have a good amount of equity at the start. You may opt to pay points to lower your rate over the loan term, meaning you pay more initially. One strategy that makes financial sense for many people is to pay points to improve the rate over the term of the loan. You are paying more up front, but you will come out ahead in the long run.