Preheat the oven to 300?F.
Drain the beans and put them in a pot with 1/4 teaspoon cayenne, the salt, and bay leaves. Add 8 cups water and bring to a boil. Reduce the heat to medium-low and simmer until the beans are just tender, 45 minutes to 1 hour. Remove from the heat and let sit for 5 minutes. Drain the beans and reserve 1 1/2 cups of the cooking liquid.
Heat the oil in a large ovenproof pot or Dutch oven over high heat. Add the salt pork and bacon and cook, stirring, for 4 minutes. Add the ketchup, reserved cooking liquid, onions, celery, brown sugar, mustard, garlic, black pepper, and remaining
1 teaspoon cayenne. Cook, stirring, for 4 minutes. Reduce the heat to medium-low. Add the beans and stir gently to mix. Simmer for 5 minutes.
Transfer the beans to the oven and bake for 2 hours. Remove from the oven and serve hot. Remove the bay leaves before serving.
Makes 6 to 8 servings