You can hand back the keys, but make sure you tell the mortgage lender in writing (& keep a copy) what you are doing, and get a receipt.
But they will go on adding interest until the house is sold. They will also add various other costs for security, solicitors, agents etc. & the house is likely to be sold for less than if you sold it yourself.
Once they had sold, they would deduct all the outstanding mortgage interest and capital and all their other costs from the amount it sold for and - if there was anything over - send it to you. If the total costs exceeded the amount it sold for, they would come after you for that shortfall amount.