code: func (ssa *SQLStorageAuthority) CountPendingAuthorizations(ctx context.Context, regID int64) (count int, err error) {
  	err = ssa.dbMap.WithContext(ctx).SelectOne(&count,
  		`SELECT count(1) FROM pendingAuthorizations
  		WHERE registrationID = :regID AND
  		expires > :now AND
  		status = :pending`,
  		map[string]interface{}{
  			"regID":   regID,
  			"now":     ssa.clk.Now(),
  			"pending": string(core.StatusPending),
  		})
  	return
  }
docs: // CountPendingAuthorizations returns the number of pending, unexpired
  // authorizations for the given registration.