We use this function to determine if for a given nonce there's an entry in siwe_nonces AND it hasn't expired (creation_time > Date.now() - nonceLifetime). If such a row exists, we delete it so it can't be used again. We determine whether a row existed by looking at QueryResults.affectedRows.
By effectively checking and deleting in the same query we can ensure that even if there is a flood of requests with the same nonce, one and only one will pass this check.
Depends on D6031
Does this apply to all targets now? Are we sure we want to apply it to all targets? Is it possibly that we're inadvertedly applying it to some targets we haven't considered? (Targets that aren't the Comm app, or the notification service extension)