UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ax/ZvtUWYfxXLxFRdRGNgkNmaet1pa44DOO6AienvSQ='
WHERE
key_id = 'e60eeb416387c552a5523f6abda2bac86f18e842cc882846c2718eef4a20f724'
AND (
token = 'Ax/ZvtUWYfxXLxFRdRGNgkNmaet1pa44DOO6AienvSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)