UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wnc6JJq/D6IC3HAmPdO1IYjtnruI3B56tpHZadXvtPo='
WHERE
key_id = '88be13a67bb74148dc7a7b8d7ce24505f48a07f11f979437413e40724b4a8db4'
AND (
token = 'Wnc6JJq/D6IC3HAmPdO1IYjtnruI3B56tpHZadXvtPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)