Well, upgrading 2.3.1 -> 2.3.x should be a minor change that is safe to do at almost any time, and you should plan to do that regularly, after each minor release, to get the latest security and bug fixes.
Upgrading 2.3.x to 2.4.y or 2.5.y is a bigger change. You need to read the release notes, perhaps give some advanced warning to your staff.
So, I would say, a minor upgrade is something you could do at the weekend. For a major upgrade you might consider planning to do those during the schoold vacation.
Since I don't know why you are getting these deadlocks, I cannot guess if it is likely to happen again when the teacher re-runs the quiz. Did it happen a lot, or was it just one or two students?