The $p$-ary function $f(x)$ mapping $\mathrm{GF}(p^{4k})$ to $\mathrm{GF}(p)$ and given by $f(x)={\rm Tr}_{4k}\big(ax^d+bx^2\big)$ with $a,b\in\mathrm{GF}(p^{4k})$ and $d=p^{3k}+p^{2k}-p^k+1$ is studied with the respect to its exponential sum. In the case when either $a^{p^k(p^k+1)}\neq b^{p^k+1}$ or $a^2=b^d$ with $b\neq 0$, this sum is shown to be three-valued and the values are determined. For the remaining cases, the value of the exponential sum is expressed using Jacobsthal sums of order $p^k+1$. Finding the values and the distribution of those sums is a long-lasting open problem.