UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8R8DrKSr2rz7BW0F/ewx0q7PwjR/14uo2yxDi0ROQ1Q='
WHERE
key_id = '7297b84720c9616e1cb72f1f67ffb0198cc7dc992b88f2741d157e350571813a'
AND (
token = '8R8DrKSr2rz7BW0F/ewx0q7PwjR/14uo2yxDi0ROQ1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)