  We present a calculation of the pion quark momentum fraction, $\langle x
\rangle$, and its third Mellin moment $\langle x^2 \rangle$. We also obtain
directly, for the first time, $\langle x \rangle$ and $\langle x^2 \rangle$ for
the kaon using local operators. We use an ensemble of two degenerate light, a
strange and a charm quark ($N_f=2+1+1$) of maximally twisted mass fermions with
clover improvement. The quark masses are chosen so that they reproduce a pion
mass of about 260 MeV, and a kaon mass of 530 MeV. The lattice spacing of the
ensemble is 0.093 fm and the lattice has a spatial extent of 3 fm. We analyze
several values of the source-sink time separation within the range of
$1.12-2.23$ fm to study and eliminate excited-states contributions. The
necessary renormalization functions are calculated non-perturbatively in the
RI$'$ scheme, and are converted to the $\overline{\rm MS}$ scheme at a scale of
2 GeV. The final values for the momentum fraction are $\langle x
\rangle^\pi_{u^+}=0.261(3)_{\rm stat}(6)_{\rm syst}$, $\langle x
\rangle^K_{u^+}=0.246(2)_{\rm stat}(2)_{\rm syst}$, and $\langle x
\rangle^K_{s^+}=0.317(2)_{\rm stat}(1)_{\rm syst}$. For the third Mellin
moments we find $\langle x^2 \rangle^\pi_{u^+}=0.082(21)_{\rm stat}(17)_{\rm
syst}$, $\langle x^2 \rangle^K_{u^+}=0.093(5)_{\rm stat}(3)_{\rm syst}$, and
$\langle x^2 \rangle^K_{s^+}=0.134(5)_{\rm stat}(2)_{\rm syst}$. The reported
systematic uncertainties are due to excited-state contamination. We also give
the ratio $\langle x^2 \rangle/\langle x \rangle$ which is an indication of how
quickly the PDFs lose support at large $x$.
