UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UIdOo420I+NSAssy4GRKB/LHPHhhWgQpBk5LLts11Ho='
WHERE
key_id = '541f7b5f7393aa66a2a224e842f7ad4d1efc8e481b6e04fb7e4af40b4f285451'
AND (
token = 'UIdOo420I+NSAssy4GRKB/LHPHhhWgQpBk5LLts11Ho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)