In order to generate a unique token to relate certain information in SQL, after reviewing some documentation, I see the options to generate a token that is unique. This token will be present in two tables and in each of the two tables in multiple rows. I see two options, for a 32 character token.
Option 1
$ttime = microtime(true)*1000;
$token = $ttime . str_shuffle("ABCDEFGHIJKLNMOPQR");
Option 2
$token = bin2hex(random_bytes(16));
My doubt comes from reading that it is not advisable to use the microtime() function to generate unique tokens.