Simplify function.

Now that the receipt of session tickets is no longer confirmed, message flags
are mutually exclusive which simplifies some code.
A ticket's life time depends on key rotation.
Fix unused variable name bug.

Also, correctly calculate the ticket's life time and simplify the code.