UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xZ8N1QkxMTi2PL5fY+6TDc1CGmBj0LsdPPvXx/Cq+k='
WHERE
key_id = '4df101f275dd2d4155467159bb409354f04c1fb22e4ff1923f331b633ee3599d'
AND (
token = '7xZ8N1QkxMTi2PL5fY+6TDc1CGmBj0LsdPPvXx/Cq+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)