Of course this topic is one where there are differences from country to country. But I think there are not many differences in the basic rules.
It depends of many factors how to lock in your mortgage rate. In the first place it is important the rate at the moment when you will lock a mortgage. Is it high or low? All depends of the situation at the moment.
If you wanted to lock a mortgage a year ago the best what you could do was to take one with a rate that was determined from the beginning and always the same during the whole term. But now you have to think about the rate is much higher and maybe you can best take a mortgage with a rate that can change after a few years. Best is to see that you take one where the differences in rate can not change very high.
If you have doubt you best take always a mortgage where you know the exact rate for the whole term. In most cases you have the possibility to close the mortgage after a few years and refinance it with another. You have to pay then some extra costs but the rate for the next years will be lower so that you make profit by doing this extra cost.
Think good about it and take enough advice with some friends and people who knows much about this matter because you can save a lot of money if you take the right decisions.