Hi,
We encountered similar problems trying to update the license of the datastore, and the problem exactly was that the datastore has changed itself to read only mode. Changing it to Write mode, we could update the license.
We saw the cause of the problem in the logs of the datastore. The SQL executed by the system during the Updatelicense command was returning a message like this:
"Can not execute an update sentence in read only mode transaction"
Our Arcgis Server and datastore was in version 10.5.1