UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4OSbe8mT0ePUFxk4pBoRqo/NohIrYNca3q/XuYfMms='
WHERE
key_id = 'd94f4719333b142c55e5c1f9457f0ae1bd76a4e5f64bdeb288235dc0f5b02186'
AND (
token = '+4OSbe8mT0ePUFxk4pBoRqo/NohIrYNca3q/XuYfMms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)