CORE-5546: added a function to determine if a token is expiring within a given number of milliseconds