UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UjaKUT8NTSrHTJaELyDnejqDSj1OlBmIDeZlLI6kX9M='
WHERE
key_id = '67fd34bc05daa66ed786cce357db14bbbed67a26a6c92b1aac86be428144539e'
AND (
token = 'UjaKUT8NTSrHTJaELyDnejqDSj1OlBmIDeZlLI6kX9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)