code: func (ssa *SQLStorageAuthority) CountPendingAuthorizations2(ctx context.Context, req *sapb.RegistrationID) (*sapb.Count, error) {
  	var count int64
  	err := ssa.dbMap.WithContext(ctx).SelectOne(&count,
  		`SELECT COUNT(1) FROM authz2 WHERE
  		registrationID = :regID AND
  		expires > :expires AND
  		status = :status`,
  		map[string]interface{}{
  			"regID":   *req.Id,
  			"expires": ssa.clk.Now(),
  			"status":  statusUint(core.StatusPending),
  		},
  	)
  	if err != nil {
  		return nil, err
  	}
  	// also count old style authorizations and add those to the count of
  	// new authorizations
  	oldCount, err := ssa.CountPendingAuthorizations(ctx, *req.Id)
  	if err != nil {
  		return nil, err
  	}
  	count += int64(oldCount)
  	return &sapb.Count{Count: &count}, nil
  }
docs: // CountPendingAuthorizations2 returns the number of pending, unexpired authorizations
  // for the given registration. This method is intended to deprecate CountPendingAuthorizations.