You could also use the following in the Python Console to change all expressions of each rule to $id = $atlasfeatureid
:
layer = qgis.utils.iface.activeLayer()
renderer = layer.rendererV2()
for rule in renderer.rootRule().children():
rule.setFilterExpression('$id = $atlasfeatureid')
Edit:
The above code replaces all expressions entirely. However, if you want to add another expression to an existing one, you can use:
layer = qgis.utils.iface.activeLayer()
renderer = layer.rendererV2()
for rule in renderer.rootRule().children():
rule.setFilterExpression(rule.filterExpression'({}) + 'ANDAND $id = $atlasfeatureid'.format(rule.filterExpression()))