Intrinsic plasticity of neurons, such as spontaneous threshold lowering (STL) to modulate neuronal excitability, is key to spatial attention of biological neural systems. In-memory computing with emerging memristors is expected to solve the memory bottleneck of the von Neumann architecture commonly used in conventional digital computers and is deemed a promising solution to this bioinspired computing paradigm. Nonetheless, conventional memristors are incapable of implementing the STL plasticity of neurons due to their first-order dynamics. Here, a second-order memristor is experimentally demonstrated using yttria-stabilized zirconia with Ag doping (YSZ:Ag) that exhibits STL functionality. The physical origin of the second-order dynamics, i.e., the size evolution of Ag nanoclusters, is uncovered through transmission electron microscopy (TEM), which is leveraged to model the STL neuron. STL-based spatial attention in a spiking convolutional neural network (SCNN) is demonstrated, improving the accuracy of a multiobject detection task from 70% (20%) to 90% (80%) for the object within (outside) the area receiving attention. This second-order memristor with intrinsic STL dynamics paves the way for future machine intelligence, enabling high-efficiency, compact footprint, and hardware-encoded plasticity.