UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q+o0GFeEkEfvcz8rCf1EnoK4muKmHwF8HeKpjFPBHi8='
WHERE
key_id = '3b620ab34e51dfc698c42f5deb7623dc053cdddace5dbe92e708a5b3cf3d15cb'
AND (
token = 'Q+o0GFeEkEfvcz8rCf1EnoK4muKmHwF8HeKpjFPBHi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)