The COVID-19 pandemic poses a threat to global food security, and it changes consumers' food buying and consumption behavior. This research not only investigates trends in Spanish consumers' general food shopping and consumption habits during the lockdown, but also investigates these trends from the perspective of sustainable purchasing. Specifically, total food consumption (C), food expenditure (E), and purchase of food with sustainable attributes (S) were measured. Data were collected from a semi-structured questionnaire which was distributed online among 1203 participants. The logit models showed that gender, age, employment status, and consumers' experiences were associated with total food consumption and expenditure during the lockdown. In addition, consumers' risk perceptions, shopping places, trust level in information sources, and risk preference were highly essential factors influencing consumers' preferences and sustainable behavior. Consumers' objective knowledge regarding COVID-19 was related to expenditure. Furthermore, family structure only affected expenditure, while income and place of residence influenced food consumption. Mood was associated with expenditure and the purchase of sustainable food. Household size affected purchasing behavior towards food with sustainable attributes. This research provides references for stakeholders that help them to adapt to the new COVID-19 situation. © 2021 by the authors. Licensee MDPI, Basel, Switzerland.