I have faced this a few times. (Once there was a general insistence that there was not enough time, though the number and difficulty of the questions was not noticeably different than in previous years; another time large numbers of students emailed me after the exam to say they had not known there was a question 5 on the back of the last page, despite the obligatory "THIS EXAM HAS FIVE PARTS" boilerplate on the first page.)
The first thing you do is to mark the exam in the usual way. Then you observe. Did many people leave the last question blank? Or just scribble a few quick points in a way that suggests a lack of time? If someone did the questions out of order, did they do worst on whatever question they left for last? Is there any kind of noticeable pattern to the exams that is not like the pattern you usually see for that course (eg every year, the X question might be the one everyone finds hardest; if this year the Y question, which was last on the paper, appears to have been more of a challenge then you have something observable.)
If you see no pattern and the average mark is about what you expected you don't need to do anything. If you see no pattern and the average mark is low, you can either work harder at getting the material through the heads of this particular cohort, or set an easier final to keep the average up (an approach I reject, but mention because some people do it.)
When I did see a pattern, I made the following offer to my class:
Do you think your performance on the midterm truly reflects your knowledge of the material? If you do not (for example if you feel you were constrained by a too-short time limit) then you may use your mark on the final exam as a replacement for your mark on the midterm. You must request this accommodation within one week from today.
That last constraint was very deliberate. You have written the midterm. You have received your marked midterm. We have taken up solutions to the midterm questions and discussed particular areas where you may not have known something or may have been in error. You have a good grasp right now of what part of your mark deficit (my students always seem to have some mark they believe they deserve, and want to know why they didn't get that mark, as though I start at 100 and subtract) comes from "not getting it" and what part comes from "running out of time". If you think the real issue was running out of time, then you know that right now.
There was always someone who wanted me to mark their final exam and then only use that mark if it was better than the midterm. No way. This isn't some sort of bet or optimizing technique. This is a one-time offer: if you're so sure that midterm was not a reasonable instrument for assessing you, I'll throw it out. I'll use my remaining instrument, the final exam, for assessing that part of your mark. (Assignments in my class were group work and in any event assignments and exams assess different skills and knowledge; I would only be willing to substitute exam for exam.)
In years where there were many complaints, some (but not all) of the complainers would take the deal. Rarely, it would be really good for them. Say 50% on the midterm and 90% on the final exam. Often, it would be a small improvement - 60% on the midterm and 70% on the final exam. Over half the time, it didn't help them at all. They got 50% on the midterm and 50% on the final exam too, even though there were no time complaints on the final and they may have left early (I write finishing times on all final exam papers as I receive them.) So I'm not entirely sure this approach solves the actual problem of some students getting lower marks than they deserve on the midterm due to lack of time. However it completely solves the problem of students complaining because they believe they got a lower mark on the midterm than they deserve. And where there has been a true mismeasurement, it does fix that.