where(user_id: system_user.id).
where(api_client_id: apiClient.id).
where_serialized(:scopes, ['all']).
- where('(expires_at IS NULL OR expires_at > CURRENT_TIMESTAMP AT TIME ZONE ?)', 'UTC').
+ where('(expires_at IS NULL OR expires_at > CURRENT_TIMESTAMP)').
first
# none exist; create one with the supplied token