public static function refreshUser(User $user, $route)
    {
        // skip the process if an api user is try to refresh.
        if ($user->is_api_user) {
            return;
        }
        
        $model = self::findOne(['user_id' => $user->id]);
        
        if ($model) {
            return (bool) $model->updateAttributes(['last_timestamp' => time(), 'invoken_route' => $route]);
        }
        
        $model = new self(['last_timestamp' => time(), 'user_id' => $user->id, 'invoken_route' => $route]);
        return $model->save();
    }