code: func (ssa *SQLStorageAuthority) GetPendingAuthorization2(ctx context.Context, req *sapb.GetPendingAuthorizationRequest) (*corepb.Authorization, error) {
  	var am authz2Model
  	err := ssa.dbMap.WithContext(ctx).SelectOne(
  		&am,
  		fmt.Sprintf(`SELECT %s FROM authz2 WHERE
  			registrationID = :regID AND
  			identifierValue = :ident AND
  			status = :status AND
  			expires > :validUntil
  			ORDER BY expires ASC
  			LIMIT 1 `, authz2Fields),
  		map[string]interface{}{
  			"regID":      *req.RegistrationID,
  			"ident":      *req.IdentifierValue,
  			"status":     statusUint(core.StatusPending),
  			"validUntil": time.Unix(0, *req.ValidUntil),
  		},
  	)
  	if err != nil {
  		if err == sql.ErrNoRows {
  			// there may be an old style pending authorization so look for that
  			authz, err := ssa.GetPendingAuthorization(ctx, req)
  			if err != nil {
  				return nil, err
  			}
  			return bgrpc.AuthzToPB(*authz)
  		}
  		return nil, err
  	}
  	return modelToAuthzPB(&am)
  }
docs: // GetPendingAuthorization2 returns the most recent Pending authorization with
  // the given identifier, if available. This method is intended to deprecate
  // GetPendingAuthorization.