If you're going to save the raw content to your db using an AWS Lambda, I recommend stringifying within your Lambda code so you can then escape the single quotes; Then store it:
const escapedValueToStore = JSON.stringify(contentStateObject).replace(/'/g, '\'\'');
It's a bit involved, but it's basically because you stringify your data object when sending to your Lambda (via API Gateway) using POST.
You then need to parse that object, which then returns your ContentState into an Object without escaping the single quotes. You do the above-mentioned code to escape the quotes.
When using the data client side, all you need to do is parse it again as you convert it from raw:
EditorState.createWithContent(convertFromRaw(JSON.parse(rawContentState))
EDIT
On second thought, I guess you can just stringify, and escape the content on the client-side as well 🤔