At renewal, switching is much simpler than a mid-term break — there is no prepayment penalty because your term is ending anyway. Most switches take 30–45 days and the new lender typically covers appraisal and legal fees under a 'switch program'.
The real cost of switching
Direct costs are usually $300–$1,500: a discharge fee from your old lender ($200–$400), and sometimes appraisal and legal fees ($500–$1,000) if the new lender's switch program doesn't cover them.
Compare that against your total savings from a lower rate. On a $500,000 mortgage, a 0.50% rate improvement saves roughly $135/month or $8,100 over a five-year term. Even after $1,500 in switching costs you're still ahead by $6,600.
When switching doesn't make sense
If your current lender matches the market rate, stay put. If you have a HELOC or collateral charge mortgage, switching may require re-registering the charge, which adds legal cost. If your credit or income has weakened since origination, you may not qualify at a new lender at all — which is exactly why the bank feels comfortable offering you a mediocre rate.