Problem understanding the Expectation Operator
Consider a discrete-time, discrete valued random process $X[n,s)$ whose samples $x[n]$ at integer index $n$ belong to range space $R_{X_n} = \{x_1,x_2,...,x_n\}$ of discrete valued random variables $X_n$ indexed by $n$, such that at each $n$, the value $x[n]$ is the result of the mapping by $X_n$ into $R_{X_n}$; i.e., $X[n,s) = X_n(s) = x[n]$, where $s$ is the sample output of the experiment performed at time $n$.

The expectetation of a particular random variable $X_n$ of the random process is
$$\mathcal{E} \{ X_n \} = \sum_{x_k \in R_{X_n}} x_k P_{X_n}(x_k) = \int_{-\infty}^{\infty} x f_{X_n}(x) dx $$
where those $x_k$ belong to the range space of the random variable $X_n$ and $P_{X_n}(x_k)$ are the probabilities of those values. Note that the integral definition is also available for those who would still like to use a continuous random variable approach with impulsive PDFs; $$f_{X_n}(x) = \sum_k P_{X_n}(x_k) \delta(x-x_k) $$

The correlation between two (real) random variables $X_n$ and $X_m$ is defined as
$$\mathcal{E} \{ X_n X_m \} = \sum_{k} \sum_{l} x_k x_l P_{X_n,X_m}(x_k,x_l) $$
where $P_{X_n,X_m}(x_k,x_l)$ is the joint probability mass function of the two random variables, and signifies the probability of the pair $(x_k,x_l)$ in the range space of the joint mapping.

When those two random variables belong to the same random process, then the correlation is defined as auto-correlation of the random process.

Note that the second sum in your post does not represent an expectation but rather a possibly ergodic estimate of it for a WSS random process.