The failover path seems to need one more distinction: a definite rejection versus a timeout after the provider may have accepted the SMS. A provider-scoped idempotency key may not carry across to the fallback provider. I'd test 'A accepts, response is lost, B is selected' and document how that uncertain outcome is reconciled or deliberately retried. Row locking alone cannot settle what happened outside the database.
SMTasker