<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def access_token_valid(self, token, log_msg):
 """Check token validity. Returns true if the token is valid. The set of allowed access tokens is stored in self.access_tokens. Uses log_msg as prefix to info level log message of acceptance or rejection. """

        if (token in self.access_tokens):
            (cookie, issue_time) = self.access_tokens[token]
            age = int(time.time()) - issue_time
            if (age <= (self.access_token_lifetime + 1)):
                self.logger.info(log_msg + " " + token +
                                 " ACCEPTED TOKEN (%ds old)" % age)
                return True
            # Expired...
            self.logger.info(log_msg + " " + token +
                             " EXPIRED TOKEN (%ds old > %ds)" %
                             (age, self.access_token_lifetime))
            # Keep token for 2x lifetim in order to generate
            # helpful expired message
            if (age > (self.access_token_lifetime * 2)):
                del self.access_tokens[token]
            return False
        else:
            self.logger.info(log_msg + " " + token + " REJECTED TOKEN")
            return False