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 1/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.
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.