We prove that commutative semirings in a cartesian closed presentable ∞-category, as defined by Groth, Gepner, and Nikolaus, are equivalent to product-preserving functors from the (2,1)-category of bispans of finite sets. In other words, we identify the latter as the Lawvere theory for commutative semirings in the ∞-categorical context. This implies that connective commutative ring spectra can be described as grouplike product-preserving functors from bispans of finite sets to spaces. A key part of the proof is a localization result for ∞-categories of spans, and more generally for ∞-categories with factorization systems, that may be of independent interest.