When creating tickets, you have the option to select their validity and expiry dates and times. You must click on "edit" a list of tickets, then go to the "Advanced Options".
This allows you, for example, to sell tickets with access "before 10 p.m.". In this case, we advise you to put a validity until 10:05 p.m. to leave a small time margin to users.