Logging Out User Based On Conditions

I have an expiration time field in user table. So if current time becomes greater then expiration time user is banned from login. I have implemented this feature and it is working fine. But what if user had login before expiration time? How can I put a check that if current time become greater then user is logged out automatically and immediately? or better question is where should I put such check condition?