UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1oqfaEuENkrCGFsOL6PHhelDd+B5gHiIr+D/JLKG1bQ='
WHERE
key_id = '583ac709e55d7b014389d952d11b73ba0608aa97d4de02a2e530fd33a5b6aaa4'
AND (
token = '1oqfaEuENkrCGFsOL6PHhelDd+B5gHiIr+D/JLKG1bQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)