A simple solution is using command IF to check existence of *.jpg for current *.pdf file:
for /R %%I in (*.pdf) do if not exist "%%~dpnI.jpg" magick -density 120 "%%I" -quality 90 "%%~dpnI.jpg"
Another possibility is to use the archive attribute of files which is automatically set if a file is created or modified in a directory.
for /F "delims=" %%I in ('dir *.pdf /AA-D-H /B /S 2^>nul') do (
%SystemRoot%\System32\attrib.exe -a "%%I"
magick -density 120 "%%I" -quality 90 "%%~dpnI.jpg"
)
The main advantage of using this solution is that a PDF file once converted to a JPEG file is overwritten, the conversion to JPEG is done once again for updated PDF file.
For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.
attrib /?
dir /?
for /?
if /?