The DOIs are permanently saved in the article_settings table first time when they are used, i.t. when the article is published and when
-- using an export (not only CrossRef but also some others e.g. OJS native),
-- viewing the article or
-- harvesting via OAI.
As journal editor you can preview a DOI (before publishing the article) in the article metadata (article summary view > edit metadata) and thus see how it will look like when the article is published.
To retrieve an article DOI you will first have to get the article object, using the article_id. Then:
-- if you would like to retrieve the stored DOI, you would use $article->getStoredPubId('doi'); For this the DOI plug-in doesn't have to be enabled.
-- if you would like to generate DOI without permanently saving it, i.e. if you would just like to preview it, you would use $article->getPubId('doi', true); For this the DOI plug-in has to be enabled.
-- if you would like to generate DOI and to permanently save it, you would use $article->getPubId('doi'); For this the DOI plug-in has to be enabled.
I hope this helps.