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