Made from rubber, foam, cork or other materials, expansion joints are easily dislodged if the material is rotted. No matter how you choose to repair the damage, you first need to remove rotted material and debris. Always wear gloves, and use a hammer and chisel or pry bar to remove the material. Spray the exposed gap with a hose to force out any remnants, then let it dry.
If the damaged expansion joint is at least 1/4 inch wide, use foam backer rod to fill the majority of the joint. Cut the rod to fit the length of the patched area and press it into the expanse, leaving about a 3/4-inch expanse between the top of the backer rod and the surface of the concrete. Fill the remaining gap with expansion joint compound and smooth the surface with a putty knife.
If the expansion joint needing to be patched is less than 1/4 inch thick, fill the narrow space with sand until it is 1/2 inch from the surface. Use a caulk gun to apply concrete crack filler around the edges and directly over the sand. Tamp the material down with a trowel, and continue caulking until the material is level with the surface of the driveway.
Once the patching compound dries, brush expansion joint sealant over the entire joint. This product is manufactured with particles of fibrous material such as cork to give it enough flexibility to move with the joint. Note when you seal the joints, and plan to re-seal them every two or three years.