def METHOD_NAME(self, latest_version, current_time):
    # Attempt to write out our version check file
    with lockfile.FileLock(self.lockfile_path).locked(timeout=10):
        state = {
            'last_check': current_time.strftime(SELFCHECK_DATE_FMT),
            'latest_version': latest_version,
        }
        with open(self.statefile_path, 'w') as statefile:
            json.dump(state, statefile, sort_keys=True,
                      separators=(',', ':'))