<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_sync(self):
 """Check if sync is required based on last sync date."""

        # If refresh interval is not specified, we should refresh every time.
        expiration = utcnow()
        refresh_td = current_app.config.get('GITHUB_REFRESH_TIMEDELTA')
        if refresh_td:
            expiration -= refresh_td
        last_sync = parse_timestamp(self.account.extra_data['last_sync'])
        return last_sync < expiration