Peel and chop the onion. In a large pan, sauté it in the olive oil over medium heat until soft and beginning to brown.
If using, wash and finely chop the celery. Add it to the pan and cook over high heat with the lid on for about 4 minutes, stirring 2–3 times, until slightly softened.
Stir in the beans (with their liquid), tomato paste, mustard, smoked paprika, cumin, and chili powder or cayenne. Simmer uncovered for 5 minutes, stirring occasionally.
Add the molasses, soy sauce (or tamari), salt, and pepper. Taste and adjust seasoning as needed.
Turn off the heat and stir in the chopped parsley, if using. Serve warm.