Added method to check if the the token is valid and is not expired.