UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vgyTMGxX7mrl3uBPYctJ1UnSXn/sSiItvrq+s84qoWM='
WHERE
key_id = 'cfadf05029b6c0edaf7228da78c3300e09a671cad899711de36a56d398dab017'
AND (
token = 'vgyTMGxX7mrl3uBPYctJ1UnSXn/sSiItvrq+s84qoWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)