Its frustrating for us fans to be in the dark about whether or not your best player is going to sign an improved deal or leave, but negotiations have probably been going on for a few months now. Negotiations that are based around what league we are in next season with a set of scenarios and deals on the table to reflect the two possible outcomes. Now we know where we are playing our football for 23/24 there will be much more clarity. I know I'm stating the obvious there btw!
I can see him signing another deal at boro, partly to repay the club for resurrecting his career (so we can get a better fee for him when any prem clubs decided to take a punt on him in the following 6 - 12 months.)
I can see it going the way of signing a new deal but having a clause to say that if a fee of over '£x' amount comes in, we wont stand in his way of leaving. I think that satisfies both parties and is what I would do.