When does Zend Framework delete entries from the session table?

After we switched our project from PHP5 to PHP7, there were problems during SELECT (deadlocks) and DELETE (timeouts) commands on the session table. We didn’t take a look at it for a long time, but there were more than 20 Million (!) entries since Octoboer 2020. Obviously, the deletion which took too long ruined the select statement.