### Description

The [Get API key information API](https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-api-key.html) can currently filter the returned keys by:
 * key id/name
 * keys owned by the calling user
 * keys owned by other users, by `realm_name` and `username`

Irrespective of the filtering used, both invalidated and expired (but not yet deleted) keys will be included in the response.
In the response, keys have the `invalidated` boolean property, as well as the `expiration` property that contains the UNIX timestamp past of which the key is no longer valid for authentication.

I propose we introduce a way for the API to support retrieving:
* only valid API keys (not return invalidated keys) - using a boolean request parameter
* keys not expired before a certain timestamp - using a timestamp parameter that defaults to "now" - also note that keys' experiation date is always checked against the local node's clock
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java
ApiKeyService.validateApiKeyTypeAndExpiration(apiKeyDoc2, apiKeyCredentials2, clock, future2);
        final AuthenticationResult<User> auth2 = future2.actionGet();
        assertThat(auth2.getStatus(), is(AuthenticationResult.Status.CONTINUE));
        assertThat(auth2.getValue(), nullValue());
        assertThat(auth2.getMessage(), containsString("api key is expired"));
        
        final var apiKeyDoc3 = buildApiKeyDoc(
            hash,
            randomFrom(-1L, futureTime),
            false,
            randomAlphaOfLengthBetween(3, 8),
            Version.CURRENT.id
        );
        final ApiKeyCredentials apiKeyCredentials3 = getApiKeyCredentials(apiKeyId, apiKey, apiKeyDoc3.type);
        final PlainActionFuture<AuthenticationResult<User>> future3 = new PlainActionFuture<>();
        ApiKeyService.validateApiKeyTypeAndExpiration(apiKeyDoc3, apiKeyCredentials3, clock, future3);
        final AuthenticationResult<User> auth3 = future3.actionGet();
        assertThat(auth3.getStatus(), is(AuthenticationResult.Status.SUCCESS));
        assertThat(auth3.getValue(), notNullValue());
        assertThat(auth3.getMetadata(), hasEntry(API_KEY_TYPE_KEY, apiKeyDoc3.type.value()));
    }
    public void testCreateOrUpdateApiKeyWithWorkflowsRestrictionForUnsupportedVersion() {
        final Authentication authentication = AuthenticationTestHelper.builder().build();
        final ClusterService clusterService = mock(ClusterService.class);
        when(clusterService.getClusterSettings()).thenReturn(
            new ClusterSettings(Settings.EMPTY, Set.of(ApiKeyService.DELETE_RETENTION_PERIOD))
        );
        final ClusterState clusterState = mock(ClusterState.class);
        when(clusterService.state()).thenReturn(clusterState);
        final TransportVersion minTransportVersion = TransportVersionUtils.randomVersionBetween(