the point is that when the counter reaches 0, they are logged because the session has timed out.
So this script redirects to a page where you can update the status in your database.
I understand that the user is already logged out, but your using the script to redirect to a page where you can act on that fact
you need to add the Update record behavior to the page that script redirects to to update the status in the database.
the script is giving you a way to create a session timed out trigger, you need to create the page that will act on it.