In case someone is stuck with this error, the best way is to hunt for the *.rpmnew file which the installer leaves behind (It will not replace the the file which has user modifications).
Migrate your changes from the old
/usr/lib/systemd/system/elasticsearch.service
to the
/usr/lib/systemd/system/elasticsearch.service.rpmnew
In my case it was just adding this variable
LimitMEMLOCK=infinity
Then take a backup of the old elasticsearch.service file and copy the contents of
/usr/lib/systemd/system/elasticsearch.service.rpmnew
to
/usr/lib/systemd/system/elasticsearch.service