<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def refresh_token(self, pattern=KEY_PATTERN):
 """ Replace token with a new generated one """

        self.token = generate_token(pattern)
        self.save()