  The rare kaon decay $K^+\to\pi^+\nu\bar{\nu}$ is an ideal process in which to
search for signs of new physics and is the primary goal of the NA62 experiment
at CERN. In this paper we report on a lattice QCD calculation of the
long-distance contribution to the $K^+\to\pi^+\nu\bar{\nu}$ decay amplitude at
the near-physical pion mass $m_\pi=170$ MeV. The calculations are however,
performed on a coarse lattice and hence with a lighter charm quark mass
($m_c^{\bar{\mathrm{MS}}}(\mbox{3 GeV})=750$ MeV) than the physical one. The
main aims of this study are two-fold. Firstly we study the momentum dependence
of the amplitude and conclude that it is very mild so that a computation at
physical masses even at a single kinematic point would provide a good estimate
of the long-distance contribution to the decay rate. Secondly we compute the
contribution to the branching ratio from the two-pion intermediate state whose
energy is below the kaon mass and find that it is less than 1% after its
exponentially growing unphysical contribution has been removed and that the
corresponding non-exponential finite-volume effects are negligibly small.
