code: def update_token(self):
          
          if not self.username or not self.password:
              raise errors.TokenExpired("Unable to refresh token - no username or password.")
          encoded_uri = compat.quote_plus(self.uri).encode(self._encoding)  # pylint: disable=no-member
          encoded_key = compat.quote_plus(self.username).encode(self._encoding)  # pylint: disable=no-member
          self.expires_at = time.time() + self.expires_in.seconds
          self.token = utils.create_sas_token(
              encoded_key,
              self.password.encode(self._encoding),
              encoded_uri,
              self.expires_in)
docs: If a username and password are present - attempt to use them to
          request a fresh SAS token.