Put the water, carrot, celery, onion, garlic, lemon, parsley, thyme, and bay leaves in a pot and bring to a boil over high heat. Lower the heat to a simmer, set a cover on top slightly ajar, and cook for 10 to 30 minutes.
Drop the shrimp into the liquid and turn off the heat. Cook the shrimp, stirring occasionally, until they curl and turn pink, about 2 to 2½ minutes for medium shrimp, 3 minutes for large ones. Drain and cool to room temperature. Peel the shrimp and remove the vein along the curve of the shrimp, if desired. Refrigerate if not serving right away. If refrigerated, bring the shrimp to room temperature 20 minutes before serving.
To serve put the cocktail sauce in a medium bowl and surround with the shrimp, or loop the shrimp over the edge of an individual cocktail glass and top with the sauce. Garnish with the lemon and serve.
Optional Tip: To de-vein the shrimp before cooking, hold a shrimp between the thumb and forefinger with the rounded side of the shrimp upward. Place the pointed end of a wooden skewer at the junction of the second and third segments of the shrimp shell, about 1/8-inch down from the top. Gently push the skewer through the shell and then lift up to remove the vein.
Combine the ketchup, lemon zest and juice, horseradish, and Worcestershire sauce in a small bowl. Add hot sauce, if desired. Mix well, then refrigerate until ready to serve.